Export interface for external call#2131
Export interface for external call#2131TaranDahl wants to merge 5 commits intoPhobos-developers:developfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a small C ABI “Interop” surface to Phobos so other engine extensions can call into selected Phobos systems at runtime (DLL exports), along with documentation/changelog entries announcing the feature.
Changes:
- Introduces exported interop functions for
TechnoExt::ConvertToTypeand AttachEffect attach/detach/transfer operations. - Wires the new interop sources into the MSBuild project.
- Documents the new interoperability entry in README, Whats-New, and CREDITS.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Interop/TechnoExt.h | Declares exported ConvertToType_Phobos C ABI function. |
| src/Interop/TechnoExt.cpp | Implements the exported type-conversion wrapper. |
| src/Interop/AttachEffect.h | Declares exported C ABI functions for AttachEffect operations. |
| src/Interop/AttachEffect.cpp | Implements exported wrappers for attaching/detaching/transferring effects. |
| docs/Whats-New.md | Adds a changelog entry referencing the new interop feature. |
| README.md | Adds an “Interoperability” section pointing to src/Interop. |
| Phobos.vcxproj | Adds the new interop .cpp/.h files to the build. |
| CREDITS.md | Adds credit entry for the interop export feature. |
|
Nightly build for this pull request:
This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build. |
|
I am not sure why all pointers are |
My bet would be that to make it so that this does not depend on YRpp (in case someone is using their own implementation of YRpp, perhaps) |
Copilot said that if I use TechnoClass*, it will break the P/Invoke compatibility. When calling in C#, I can't directly use IntPtr. I have to do type mapping, otherwise the call will fail. |
This sounds like AI hallucinations...
|
Changed |
Co-authored-by: Noble Fish <89088785+DeathFishAtEase@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
To Chinese users:
|
|
Macros like PHOBOS_EXPORT and PHOBOS_DECL can make the code cleaner and such macros are widely used in most projects. #define PHOBOS_DECL __stdcall
#define PHOBOS_EXPORT extern "C" __declspec(dllexport) |
Interoperability
Phobos has opened the external interfaces of some key components. If you are also developing your own engine extension and wish to use Phobos at the same time, please check out Interop.